//
// Created by Asus on 2023/3/29.
//
#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
#include <string.h>
#include"../../HeadFiles/ChainsH/RecordChain.h"
#include "../../HeadFiles/TotalProfit.h"
#define SPLIT_STR "------------------------"
extern struct RecordNode * recordHead, * recordTail;
int OverPage() {
    while (1) {
        system("cls");
        printf("welcome!\n");
        printf("type 1 to view profit and loss\n");
        printf("type 2 to predict commodity sales trends\n");
        printf("type 0 to go back\n");
        puts(SPLIT_STR);
        char p;
        p = getche();
        while(!(p == '1' || p == '2' || p == '0'))
        {
            puts("Illegal input detected! Try again:");
            p = getche();
        }

        //用字符串接收输入

        if (p == '1')
            //查看利润相关
        {
            proFit(recordHead);
        }
        else if (p == '2')
            //预测商品销售走势
        {
        }

        else if (p == '0')
        {
            // goto Welcome_Page;

            return 0;
        }
        else
        {
            printf("Illegal input detected! Try again:\n");
            system("pause");
        }

    }
}